package com.dk.aop;

import com.dk.WR;
import com.dk.config.DyDatasource;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

/**
 * @author zh
 * @Description TODO
 * @createTime 2023/11/23
 */
@Component
@Aspect
public class WRaop {


    @Before("within(com.dk.service.impl.*)&&@annotation(wr)")
    public void before(JoinPoint joinPoint, WR wr){
        String value = wr.value();
        DyDatasource.t.set(value);
    }
}
